import {get, outPost, post, put, remove} from "../http.js";
// 用户相关的接口
export function getAllUser(page,limit){
    return get(`user/getAllUser/${page}/${limit}`)
}
export function addUser(form){
    return put("/user/addUser",form)
}
export function editUser(form){
    return post("/user/editUser",form)
}
export function removeUser(userNo){
    return remove(`/user/removeUser/${userNo}`)
}
export function checkCount(userAccount){
    return get(`/user/check/${userAccount}`)
}
export function login(user){
    return post("/user/login",user)
}
export function register(user){
    return post("/user/register",user)
}
export function verificationCode(){
    return get("/user/verificationCode")
}
export function verification(code,value){
    return post("/user/verification",{"code":code,"value":value})
}
export function batchRemoveUser(id){
    return remove("/user/batchRemoveUser/"+id)
}
export function searchUser(search){
    return post("/user/searchUser",search)
}
export function batchAddUser(users){
    return post("/user/batchAddUser",users)
}
export function batchOutUser(users){
    return outPost("/user/batchOutUser",users)
}
export function getAllTable(database){
    return get("/codebuild/getAllTable/"+database)
}
export function build(tables){
    return post("/codebuild/build",tables)
}
export function getUserRole(user){
    return get("/user/getUserRole/"+user)
}
export function addUserRole(user,role){
    return post("/user/addUserRole",{"user":user,"roleArray":role})
}
